from django.db import models

from myuser.models import MyUser
from prj004.models.models import CreateTimeModel
from prj004.models.info import Info


class Summary(CreateTimeModel):
    owner = models.ForeignKey(MyUser, on_delete=models.CASCADE, related_name='prj004_summary')

    info = models.OneToOneField(Info, related_name='summary', on_delete=models.CASCADE)

    zhusu = models.IntegerField(blank=True, null=True, verbose_name='主诉-反复自然流产', help_text='主诉-反复自然流产')

    liuchan_six = models.BooleanField(blank=True, default=False, verbose_name='既往自然流产孕周及次数-<6周', help_text='既往自然流产孕周及次数-<6周')
    liuchan_six_times = models.IntegerField(blank=True, null=True, verbose_name='既往自然流产孕周及次数-<6周-次数', help_text='既往自然流产孕周及次数-<6周-次数')

    liuchan_eight = models.BooleanField(blank=True, default=False, verbose_name='既往自然流产孕周及次数-≥6周<8周', help_text='既往自然流产孕周及次数≥6周<8周')
    liuchan_eight_times = models.IntegerField(blank=True, null=True, verbose_name='既往自然流产孕周及次数-≥6周<8周-次数', help_text='既往自然流产孕周及次数≥6周<8周-次数')

    liuchan_ten = models.BooleanField(blank=True, default=False, verbose_name='既往自然流产孕周及次数≥8周<10周', help_text='既往自然流产孕周及次数≥8周<10周')
    liuchan_ten_times = models.IntegerField(blank=True, null=True, verbose_name='既往自然流产孕周及次数≥8周<10周-次数', help_text='既往自然流产孕周及次数≥8周<10周-次数')

    liuchan_twelve = models.BooleanField(blank=True, default=False, verbose_name='既往自然流产孕周及次数≥10周<12周', help_text='既往自然流产孕周及次数≥10周<12周')
    liuchan_twelve_times = models.IntegerField(blank=True, null=True, verbose_name='既往自然流产孕周及次数≥10周<12周-次数', help_text='既往自然流产孕周及次数≥10周<12周-次数')

    liuchan_twenty = models.BooleanField(blank=True, default=False, verbose_name='既往自然流产孕周及次数≥12周＜20周', help_text='既往自然流产孕周及次数≥12周＜20周')
    liuchan_twenty_times = models.IntegerField(blank=True, null=True, verbose_name='既往自然流产孕周及次数≥12周＜20周-次数', help_text='既往自然流产孕周及次数≥12周＜20周-次数')

    liuchan_most = models.BooleanField(blank=True, default=False, verbose_name='既往自然流产孕周及次数≥20周', help_text='既往自然流产孕周及次数≥20周')
    liuchan_most_times = models.IntegerField(blank=True, null=True, verbose_name='既往自然流产孕周及次数≥20周-次数', help_text='既往自然流产孕周及次数≥20周-次数')

    liuchan_last_time = models.CharField(max_length=7, blank=True, null=True, verbose_name='最近一次流产时间[YYYY-MM]', help_text='最近一次流产时间[YYYY-MM]')

    live_is_checked = models.BooleanField(blank=True, default=False, verbose_name='是否活产过', help_text='是否活产过')

    shunchan = models.BooleanField(blank=True, default=False, verbose_name='活产次数及方式-顺产', help_text='活产次数及方式-顺产')
    shunchan_times = models.IntegerField(blank=True, null=True, verbose_name='活产次数及方式-顺产次数', help_text='活产次数及方式-顺产次数')

    poufu = models.BooleanField(blank=True, default=False, verbose_name='活产次数及方式-剖腹', help_text='活产次数及方式-剖腹')
    poufu_times = models.IntegerField(blank=True, null=True, verbose_name='活产次数及方式-剖腹次数', help_text='活产次数及方式-剖腹次数')

    last_live = models.CharField(max_length=7, blank=True, null=True, help_text="最近一次活产时间[YYYY-MM]", verbose_name='最近一次活产时间[YYYY-MM]')

    last_time = models.DateField(blank=True, null=True, verbose_name='末次月经时间', help_text='末次月经时间')

    RENCHEN_CHOICES = (
        ('是', '是'),
        ('否', '否'),
        ('不详', '不祥')
    )
    renchen = models.CharField(max_length=4, choices=RENCHEN_CHOICES, blank=True, null=True, verbose_name='是否妊娠中', help_text='是否妊娠中')

    renchen_ing = models.IntegerField(blank=True, null=True, verbose_name='妊娠中-孕周', help_text='妊娠中-孕周')

    spirit_chongpei = models.BooleanField(blank=True, default=False, verbose_name='精力充沛', help_text="精力充沛")

    spirit_yiban = models.BooleanField(blank=True, default=False, verbose_name='精神一般', help_text="精神一般")

    spirit_fali = models.BooleanField(blank=True, default=False, verbose_name='神疲乏力', help_text="神疲乏力")

    spirit_jianwang = models.BooleanField(blank=True, default=False, verbose_name='健忘', help_text="健忘")

    spirit_yalida = models.BooleanField(blank=True, default=False, verbose_name='压力大', help_text="压力大")

    spirit_jinzhang = models.BooleanField(blank=True, default=False, verbose_name='紧张焦虑', help_text="紧张焦虑")

    spirit_haipa = models.BooleanField(blank=True, default=False, verbose_name='害怕不安', help_text="害怕不安")

    spirit_yiyu = models.BooleanField(blank=True, default=False, verbose_name='抑郁', help_text="抑郁")

    spirit_xinu = models.BooleanField(blank=True, default=False, verbose_name='喜怒无常', help_text="喜怒无常")

    spirit_fanzao = models.BooleanField(blank=True, default=False, verbose_name='烦躁易怒', help_text="烦躁易怒")

    spirit_beishang = models.BooleanField(blank=True, default=False, verbose_name='悲伤欲哭', help_text="悲伤欲哭")

    spirit_qita = models.CharField(max_length=50, blank=True, null=True, verbose_name='精神情绪-其他', help_text="精神情绪-其他")

    han_zc = models.BooleanField(blank=True, default=False, verbose_name='正常', help_text="正常")

    han_weihan = models.BooleanField(blank=True, default=False, verbose_name='畏寒', help_text="畏寒")

    han_wweire = models.BooleanField(blank=True, default=False, verbose_name='畏热', help_text="畏热")

    han_wuxin = models.BooleanField(blank=True, default=False, verbose_name='五心烦热', help_text="五心烦热")

    han_chaore = models.BooleanField(blank=True, default=False, verbose_name='潮热', help_text="潮热")

    han_dire = models.BooleanField(blank=True, default=False, verbose_name='低热不退', help_text="低热不退")

    han_dongze = models.BooleanField(blank=True, default=False, verbose_name='动则汗出', help_text="动则汗出")

    han_yewo = models.BooleanField(blank=True, default=False, verbose_name='夜卧汗出，醒后汗止', help_text="夜卧汗出，醒后汗止")

    han_hongre = models.BooleanField(blank=True, default=False, verbose_name='烘热汗出', help_text="烘热汗出")

    han_qita = models.CharField(max_length=50, blank=True, null=True, verbose_name='寒热及汗出-其他', help_text="寒热及汗出-其他")

    face_zc = models.BooleanField(blank=True, default=False, verbose_name='正常', help_text='正常')

    face_danbai = models.BooleanField(blank=True, default=False, verbose_name='淡白无华', help_text='淡白无华')

    face_cangbai = models.BooleanField(blank=True, default=False, verbose_name='苍白', help_text='苍白')

    face_qingbai = models.BooleanField(blank=True, default=False, verbose_name='青白', help_text='青白')

    face_fuzhong = models.BooleanField(blank=True, default=False, verbose_name='白而浮肿', help_text='白而浮肿')

    face_weihuang = models.BooleanField(blank=True, default=False, verbose_name='萎黄', help_text='萎黄')

    face_huangzhong = models.BooleanField(blank=True, default=False, verbose_name='黄肿', help_text='黄肿')

    face_chaohong = models.BooleanField(blank=True, default=False, verbose_name='潮红', help_text='潮红')

    face_huian = models.BooleanField(blank=True, default=False, verbose_name='晦黯', help_text='晦黯')

    face_anban = models.BooleanField(blank=True, default=False, verbose_name='面有黯斑', help_text='面有黯斑')

    face_qita = models.CharField(max_length=50, blank=True, null=True, verbose_name='面色-其他', help_text='面色-其他')

    face_head_zc = models.BooleanField(blank=True, default=False, verbose_name='正常', help_text='正常')

    face_head_touyun = models.BooleanField(blank=True, default=False, verbose_name='头晕', help_text='头晕')

    face_head_toutong = models.BooleanField(blank=True, default=False, verbose_name='头痛', help_text='头痛')

    face_head_touchen = models.BooleanField(blank=True, default=False, verbose_name='头沉重', help_text='头沉重')

    face_head_yanhua = models.BooleanField(blank=True, default=False, verbose_name='眼花', help_text='眼花')

    face_head_muxuan = models.BooleanField(blank=True, default=False, verbose_name='目眩', help_text='目眩')

    face_head_muse = models.BooleanField(blank=True, default=False, verbose_name='目涩', help_text='目涩')

    face_head_muyang = models.BooleanField(blank=True, default=False, verbose_name='目痒', help_text='目痒')

    face_head_erming = models.BooleanField(blank=True, default=False, verbose_name='耳鸣', help_text='耳鸣')

    face_head_erlong = models.BooleanField(blank=True, default=False, verbose_name='耳聋', help_text='耳聋')

    face_head_xiajiang = models.BooleanField(blank=True, default=False, verbose_name='听力下降', help_text='听力下降')

    face_head_cq = models.BooleanField(blank=True, default=False, verbose_name='晨起眼睑浮肿', help_text='晨起眼睑浮肿')

    face_head_qita = models.CharField(max_length=50, blank=True, null=True, verbose_name='头面部-其他', help_text='头面部-其他')

    kou_zc = models.BooleanField(blank=True, default=False, verbose_name='正常', help_text='正常')

    kou_kouku = models.BooleanField(blank=True, default=False, verbose_name='口苦', help_text='口苦')

    kou_kougan = models.BooleanField(blank=True, default=False, verbose_name='口干', help_text='口干')

    kou_kouchou = models.BooleanField(blank=True, default=False, verbose_name='口臭', help_text='口臭')

    kou_kounian = models.BooleanField(blank=True, default=False, verbose_name='口粘', help_text='口粘')

    kou_buyuyin = models.BooleanField(blank=True, default=False, verbose_name='口干不欲饮', help_text='口干不欲饮')

    kou_yantong = models.BooleanField(blank=True, default=False, verbose_name='咽痛', help_text='咽痛')

    kou_yanyang = models.BooleanField(blank=True, default=False, verbose_name='咽痒', help_text='咽痒')

    kou_yiwu = models.BooleanField(blank=True, default=False, verbose_name='咽部异物感', help_text='咽部异物感')

    kou_qita = models.CharField(max_length=50, blank=True, null=True, verbose_name='口咽部-其他', help_text='口咽部-其他')

    xiong_zc = models.BooleanField(blank=True, default=False, verbose_name='正常', help_text='正常')

    xiong_xinhuang = models.BooleanField(blank=True, default=False, verbose_name='心慌', help_text='心慌')

    xiong_qiduan = models.BooleanField(blank=True, default=False, verbose_name='气短', help_text='气短')

    xiong_fanmen = models.BooleanField(blank=True, default=False, verbose_name='心胸烦闷', help_text='心胸烦闷')

    xiong_xiongzhang = models.BooleanField(blank=True, default=False, verbose_name='胸胁胀痛', help_text='胸胁胀痛')

    xiong_xiongci = models.BooleanField(blank=True, default=False, verbose_name='胸胁刺痛', help_text='胸胁刺痛')

    xiong_ruzhang = models.BooleanField(blank=True, default=False, verbose_name='乳房胀痛', help_text='乳房胀痛')

    xiong_ruci = models.BooleanField(blank=True, default=False, verbose_name='乳房刺痛', help_text='乳房刺痛')

    xiong_xitan = models.BooleanField(blank=True, default=False, verbose_name='喜叹息', help_text='喜叹息')

    xiong_shaoqi = models.BooleanField(blank=True, default=False, verbose_name='少气懒言', help_text='少气懒言')

    xiong_qita = models.CharField(max_length=50, blank=True, null=True, verbose_name='胸胁及语音-其他', help_text='胸胁及语音-其他')

    fu_zc = models.BooleanField(blank=True, default=False, verbose_name='正常', help_text='正常')

    fu_zhui = models.BooleanField(blank=True, default=False, verbose_name='小腹坠胀', help_text='小腹坠胀')

    fu_yin = models.BooleanField(blank=True, default=False, verbose_name='小腹隐痛', help_text='小腹隐痛')

    fu_zhang = models.BooleanField(blank=True, default=False, verbose_name='小腹胀痛', help_text='小腹胀痛')

    fu_leng = models.BooleanField(blank=True, default=False, verbose_name='小腹冷痛', help_text='小腹冷痛')

    fu_citong = models.BooleanField(blank=True, default=False, verbose_name='小腹刺痛', help_text='小腹刺痛')

    fu_juan = models.BooleanField(blank=True, default=False, verbose_name='疼痛拒按', help_text='疼痛拒按')

    fu_xian = models.BooleanField(blank=True, default=False, verbose_name='疼痛喜按', help_text='疼痛喜按')

    fu_dere = models.BooleanField(blank=True, default=False, verbose_name='腹痛得热痛减', help_text='腹痛得热痛减')

    fu_suantong = models.BooleanField(blank=True, default=False, verbose_name='腰酸痛', help_text='腰酸痛')

    fu_lengtong = models.BooleanField(blank=True, default=False, verbose_name='腰冷痛', help_text='腰冷痛')

    fu_qita = models.CharField(max_length=50, blank=True, null=True, verbose_name='腹腰-其他', help_text='腹腰-其他')

    si_zc = models.BooleanField(blank=True, default=False, verbose_name='正常', help_text='正常')

    si_fa = models.BooleanField(blank=True, default=False, verbose_name='乏力', help_text='乏力')

    si_ma = models.BooleanField(blank=True, default=False, verbose_name='麻木', help_text='麻木')

    si_suan = models.BooleanField(blank=True, default=False, verbose_name='酸软', help_text='酸软')

    si_kun = models.BooleanField(blank=True, default=False, verbose_name='困重', help_text='困重')

    si_zhi = models.BooleanField(blank=True, default=False, verbose_name='肢冷', help_text='肢冷')

    si_fu = models.BooleanField(blank=True, default=False, verbose_name='浮肿', help_text='浮肿')

    si_shouzu = models.BooleanField(blank=True, default=False, verbose_name='手足心热', help_text='手足心热')

    si_qita = models.CharField(max_length=50, blank=True, null=True, verbose_name='四肢-其他', help_text='四肢-其他')

    yin_zc = models.BooleanField(blank=True, default=False, verbose_name='正常', help_text='正常')

    yin_buzhen = models.BooleanField(blank=True, default=False, verbose_name='食欲不振', help_text='食欲不振')

    yin_duoshi = models.BooleanField(blank=True, default=False, verbose_name='多食易饥', help_text='多食易饥')

    yin_pianshi = models.BooleanField(blank=True, default=False, verbose_name='偏食或挑食', help_text='偏食或挑食')

    yin_shihou = models.BooleanField(blank=True, default=False, verbose_name='食后胃脘不舒', help_text='食后胃脘不舒')

    yin_exin = models.BooleanField(blank=True, default=False, verbose_name='恶心欲呕', help_text='恶心欲呕')

    yin_fansuan = models.BooleanField(blank=True, default=False, verbose_name='嗳气反酸', help_text='嗳气反酸')

    yin_qita = models.CharField(max_length=50, blank=True, null=True, verbose_name='饮食-其他', help_text='饮食-其他')

    SHUI_TIME_CHOICES = (
        ('<4小时', '<4小时'),
        ('4-6小时', '4-6小时'),
        ('7-8小时', '7-8小时'),
        ('>8小时', '>8小时')
    )
    shui_time = models.CharField(max_length=8, choices=SHUI_TIME_CHOICES, blank=True, null=True, verbose_name='每日睡眠时间', help_text='每日睡眠时间')

    shui_wu = models.BooleanField(blank=True, default=False, verbose_name='无', help_text='无')

    shui_duo = models.BooleanField(blank=True, default=False, verbose_name='多梦', help_text='多梦')

    shui_xing = models.BooleanField(blank=True, default=False, verbose_name='性梦', help_text='性梦')

    shui_yi = models.BooleanField(blank=True, default=False, verbose_name='易醒', help_text='易醒')

    shui_kunnan = models.BooleanField(blank=True, default=False, verbose_name='入睡困难', help_text='入睡困难')

    shui_qita = models.CharField(max_length=50, blank=True, null=True, verbose_name='伴随症状-其他', help_text='伴随症状-其他')

    sex_zc = models.BooleanField(blank=True, default=False, verbose_name='正常', help_text='正常')

    sex_xingwang = models.BooleanField(blank=True, default=False, verbose_name='性欲旺盛', help_text='性欲旺盛')

    sex_xingtui = models.BooleanField(blank=True, default=False, verbose_name='性欲减退', help_text='性欲减退')

    da_zc = models.BooleanField(blank=True, default=False, verbose_name='正常', help_text='正常')

    da_biangan = models.BooleanField(blank=True, default=False, verbose_name='便干', help_text='便干')

    da_zhixi = models.BooleanField(blank=True, default=False, verbose_name='质稀', help_text='质稀')

    da_shigan = models.BooleanField(blank=True, default=False, verbose_name='时干时稀', help_text='时干时稀')

    da_xiexie = models.BooleanField(blank=True, default=False, verbose_name='泄泻', help_text='泄泻')

    da_tianliang = models.BooleanField(blank=True, default=False, verbose_name='天亮前泄泻', help_text='天亮前泄泻')

    da_zhinian = models.BooleanField(blank=True, default=False, verbose_name='质黏，排不尽', help_text='质黏，排不尽')

    da_jiaza = models.BooleanField(blank=True, default=False, verbose_name='夹杂未消化食物', help_text='夹杂未消化食物')

    da_qita = models.CharField(max_length=50, blank=True, null=True, verbose_name='大便-其他', help_text='大便-其他')

    xiao_zc = models.BooleanField(blank=True, default=False, verbose_name='正常', help_text='正常')

    xiao_duanhuang = models.BooleanField(blank=True, default=False, verbose_name='短黄', help_text='短黄')

    xiao_qingchang = models.BooleanField(blank=True, default=False, verbose_name='清长', help_text='清长')

    xiao_pinshu = models.BooleanField(blank=True, default=False, verbose_name='频数', help_text='频数')

    xiao_niaoji = models.BooleanField(blank=True, default=False, verbose_name='尿急', help_text='尿急')

    xiao_niaotong = models.BooleanField(blank=True, default=False, verbose_name='尿痛', help_text='尿痛')

    xiao_yuli = models.BooleanField(blank=True, default=False, verbose_name='余沥不尽', help_text='余沥不尽')

    xiao_shaoniao = models.BooleanField(blank=True, default=False, verbose_name='少尿', help_text='少尿')

    xiao_yeniao = models.BooleanField(blank=True, default=False, verbose_name='夜尿频', help_text='夜尿频')

    xiao_qita = models.CharField(max_length=50, blank=True, null=True, verbose_name='小便-其他', help_text='小便-其他')

    yin_xue = models.BooleanField(blank=True, default=False, verbose_name='阴道流血', help_text='阴道流血')

    HAS_XUE_CHOICES = (
        ('很少(护垫即可)', '很少(护垫即可)'),
        ('中等(卫生巾,与月经量相似)', '中等(卫生巾,与月经量相似)'),
        ('大量(多于月经量)', '大量(多于月经量)')
    )
    has_xue = models.CharField(max_length=18, choices=HAS_XUE_CHOICES, blank=True, null=True, verbose_name='阴道流血-有', help_text='阴道流血-有')

    shezhi_danhong = models.BooleanField(blank=True, default=False, verbose_name='淡红', help_text="淡红")

    shezhi_danbai = models.BooleanField(blank=True, default=False, verbose_name='淡白', help_text="淡白")

    shezhi_xianhong = models.BooleanField(blank=True, default=False, verbose_name='鲜红', help_text="鲜红")

    shezhi_shenhong = models.BooleanField(blank=True, default=False, verbose_name='深红', help_text="深红")

    shezhi_zihong = models.BooleanField(blank=True, default=False, verbose_name='紫红', help_text="紫红")

    shezhi_anhong = models.BooleanField(blank=True, default=False, verbose_name='黯红', help_text="黯红")

    shezhi_andan = models.BooleanField(blank=True, default=False, verbose_name='淡黯', help_text="淡黯")

    shezhi_zian = models.BooleanField(blank=True, default=False, verbose_name='紫黯', help_text="紫黯")

    shezhi_youyudian = models.BooleanField(blank=True, default=False, verbose_name='有瘀点或瘀斑', help_text="有瘀点或瘀斑")

    shezhi_jianhong = models.BooleanField(blank=True, default=False, verbose_name='舌边尖红', help_text="舌边尖红")

    shezhi_qita = models.CharField(max_length=50, blank=True, null=True, verbose_name='舌质-其他', help_text="舌质-其他")

    shetai_bai = models.BooleanField(blank=True, default=False, verbose_name='白', help_text='白')

    shetai_huang = models.BooleanField(blank=True, default=False, verbose_name='黄', help_text='黄')

    shetai_bo = models.BooleanField(blank=True, default=False, verbose_name='薄', help_text='薄')

    shetai_hou = models.BooleanField(blank=True, default=False, verbose_name='厚', help_text='厚')

    shetai_ni = models.BooleanField(blank=True, default=False, verbose_name='腻', help_text='腻')

    shetai_run = models.BooleanField(blank=True, default=False, verbose_name='润', help_text='润')

    shetai_hua = models.BooleanField(blank=True, default=False, verbose_name='滑', help_text='滑')

    shetai_gan = models.BooleanField(blank=True, default=False, verbose_name='干', help_text='干')

    shetai_shaotai = models.BooleanField(blank=True, default=False, verbose_name='少苔', help_text='少苔')

    shetai_huabao = models.BooleanField(blank=True, default=False, verbose_name='花剥', help_text='花剥')

    shetai_wutai = models.BooleanField(blank=True, default=False, verbose_name='无苔', help_text='无苔')

    shetai_qita = models.CharField(max_length=50, blank=True, null=True, verbose_name='舌苔-其他', help_text='舌苔-其他')

    sheti_zc = models.BooleanField(blank=True, default=False, verbose_name='正常', help_text='正常')

    sheti_shou = models.BooleanField(blank=True, default=False, verbose_name='瘦小', help_text='瘦小')

    sheti_pang = models.BooleanField(blank=True, default=False, verbose_name='胖大', help_text='胖大')

    sheti_chi = models.BooleanField(blank=True, default=False, verbose_name='有齿痕', help_text='有齿痕')

    sheti_lie = models.BooleanField(blank=True, default=False, verbose_name='有裂纹', help_text='有裂纹')

    sheti_qita = models.CharField(max_length=50, blank=True, null=True, verbose_name='舌体-其他', help_text='舌体-其他')

    mai_fu = models.BooleanField(blank=True, default=False, verbose_name='浮', help_text='浮')

    mai_chen = models.BooleanField(blank=True, default=False, verbose_name='沉', help_text='沉')

    mai_hua = models.BooleanField(blank=True, default=False, verbose_name='滑', help_text='滑')

    mai_shu = models.BooleanField(blank=True, default=False, verbose_name='数', help_text='数')

    mai_xuan = models.BooleanField(blank=True, default=False, verbose_name='弦', help_text='弦')

    mai_xi = models.BooleanField(blank=True, default=False, verbose_name='细', help_text='细')

    mai_ruo = models.BooleanField(blank=True, default=False, verbose_name='弱', help_text='弱')

    mai_huan = models.BooleanField(blank=True, default=False, verbose_name='缓', help_text='缓')

    mai_chi = models.BooleanField(blank=True, default=False, verbose_name='迟', help_text='迟')

    mai_se = models.BooleanField(blank=True, default=False, verbose_name='涩', help_text='涩')

    mai_jin = models.BooleanField(blank=True, default=False, verbose_name='紧', help_text='紧')

    mai_qita = models.CharField(max_length=50, blank=True, null=True, verbose_name='脉象-其他', help_text='脉象-其他')

    def __str__(self):
        return '{}-{}'.format(self.owner, self.info)

    class Meta:
        verbose_name = '病情概要'
        verbose_name_plural = verbose_name
